// 线上iconfont引入
require('../../fonts/iconfont.css');
require('../../css/commom/basic.css');
/**
 * 工具函数
 */

 let commomHttp='http://139.9.177.51:8099';
let utils={
    // 获取id
    getId:function(str){
        str=str.substr(1);
        let arr=str.split('&');
        let obj={};
        arr.forEach(function(item){
            let arr1=item.split('=');
            obj[arr1[0]]=arr1[1];
        })
        return obj;
    },


    testTell:function(tell){
        let reg=/^1[3|4|5|6|7|8|9][0-9]{9}$/;
        return reg.test(tell);
    },
    /***
     * footerAll  页面页脚
     */
    footerAll:function(page){
        // 创建div元素
        let footer=document.createElement('div');
        footer.id='footer';
        let str=`
        <a href="./home.html" class='${page==='home'?'f2':'f1'}'>
            <div class="home">
                <div class="iconfont icon-fangzi"></div>
                <p>首页</p>
            </div>
        </a>
        <a href="./running.html" class='${page==='running'?'f2':'f1'}'>
            <div class="running">
                <div class="iconfont icon-aixin"></div>
                <p>运动</p>
            </div>
        </a>
        <a href="./my.html" class='${page==='my'?'f2':'f1'}'>
            <div class="my">
                <div class="iconfont icon-subscriber-square"></div>
                <p>我的</p>
            </div>
        </a>
        `
        footer.innerHTML=str;
        document.querySelector('body').appendChild(footer)
    }
};
// 验证手机号



// 挂载在window上
window.utils=utils;
window.commomHttp=commomHttp;
